{% extends "base.html" %}

{% block title %}样本集列表 - 瞬变源数据展示{% endblock %}

{% block content %}
<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-header">
                <h2 class="mb-0">样本集列表</h2>
            </div>
            <div class="card-body">
                {% if datasets %}
                <div class="row">
                    {% for dataset in datasets %}
                    <div class="col-lg-4 col-md-6 col-sm-12 mb-4">
                        <div class="card transient-card h-100">
                            <div class="card-body d-flex flex-column">
                                <h5 class="card-title">
                                    <a href="{{ url_for('dataset_detail', dataset_path=dataset.source.split('/')[0] + '/' + dataset.name) }}" class="text-decoration-none">
                                        {{ dataset.name }}
                                    </a>
                                </h5>
                                <div class="mt-auto">
                                    <small class="text-muted">{{ dataset.source }}</small>
                                    <a href="{{ url_for('dataset_detail', dataset_path=dataset.source.split('/')[0] + '/' + dataset.name) }}" class="btn btn-primary btn-sm">
                                        <i class="fas fa-folder-open"></i> 查看样本集
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    {% endfor %}
                </div>
                {% else %}
                <div class="alert alert-warning">
                    <h4 class="alert-heading">暂无样本集</h4>
                    <p>当前目录下没有找到任何样本集数据。</p>
                </div>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %}